export default function createRouterTem(options) {
    return `import {createRouter, createWebHistory} from 'vue-router'
import home from './pages/home.vue'
import other from './pages/other.vue'
${ options.vuex ?  "import vuex from './pages/vuex.vue'" : ""}
${ options.jsx ? "import jsx from './pages/jsx.vue'" : "" }
${ options.mock ? "import mock from './pages/mock.vue'" : "" }

const routes = [
    {
        name:'home',
        path:'/',
        component:home,
        children:[]
    },
    {
        name:'other',
        path:'/other',
        component:other,
        children:[]
    },
    ${ options.vuex ? "{path:'/vuex',component:vuex}," : ""}
    ${ options.jsx ?  "{path:'/jsx',component:jsx}," : "" }
    ${ options.mock ? "{path:'/mock',component:mock}," : "" }
]

const router = createRouter({
    history:createWebHistory(),
    routes
})


router.beforeEach(async (to,from)=>{
    return true
})

export default router`
}